<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2019/2/22
 * Time: 15:29
 */

namespace app\Model;

use Illuminate\Database\Eloquent\Model;

class Position  extends Model
{
    /**
     * @var string
     * 数据表
     */
    protected $table='position';
    /**
     * 表明模型是否应该被打上时间戳
     *
     * @var bool
     */
    public $timestamps = false;

    //查询某公司的所有职位
    /*public function queryJob($id){
        return $this->orderByRaw('is_top desc')->where('company_id',$id)->toArray();
    }*/
    //删除职位信息
    public function delJob($id){
        return $this->where('position_id',$id)->delete();
    }
    //修改职位的开启状态
    public function statusShut($id,$num){
        return $this->where('position_id',$id)->update(['status'=>$num]);
    }
    //修改名称
    public function updName($position_id,$new_name){
        return $this->where('position_id',$position_id)->update(['position_name'=>$new_name]);
    }

}